package com.gaofans.nrpc.common.filter;

import com.gaofans.nrpc.common.protocol.Message;
import com.gaofans.nrpc.common.processor.RpcContext;
import reactor.core.publisher.Mono;

/**
 * @author GaoFans
 */
public interface FilterChain<T extends Message> {

    /**
     * 执行下一个过滤器
     * @param request
     * @param response
     * @return
     */
    Mono<Void> doFilter(T request);

    /**
     * 获取上下文对象
     * @return
     */
    RpcContext context();
}
